package com.fcgzs.springboot.controller;


import com.fcgzs.springboot.pojo.Checkgroup;
import com.fcgzs.springboot.service.CheckgroupService;
import com.fcgzs.springboot.util.PageResult;
import com.fcgzs.springboot.util.QueryPageBean;
import com.fcgzs.springboot.util.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wjd
 * @since 2021-10-12
 */
@RestController
@RequestMapping("/checkgroup")
public class CheckgroupController {

    @Reference
    private CheckgroupService checkgroupService;

    //添加、更新检查组
    @RequestMapping("/addCheckgroupInfo")
    public Result addCheckgroupInfo(@RequestBody Checkgroup checkgroup,Integer [] ids){
        return checkgroupService.addCheckgroupInfo(checkgroup,ids);
    }

    //分页查询
    @RequestMapping("/queryCheckgroupPageInfo")
    public PageResult queryCheckgroupPageInfo(@RequestBody QueryPageBean queryPageBean){ //@RequestBody在参数是json字符串时添加
        return checkgroupService.queryCheckgroupPageInfo(queryPageBean);
    }

    //删除检查组
    @RequestMapping("/deleteCheckgroupInfo")
    public Result deleteCheckgroupInfo(Integer id){
        return checkgroupService.deleteCheckgroupInfo(id);
    }

    //编辑回显数据
    @RequestMapping("/getOneCheckgroupById")
    public Result getOneCheckgroupById(Integer id){
        return checkgroupService.getOneCheckgroupById(id);
    }

    //展示所有检查组
    @RequestMapping("/showAllGroupInfo")
    public Result showAllGroupInfo(){
        return checkgroupService.showAllGroupInfo();
    }

}

